package com.company.作业;

import java.util.Scanner;

public class Main {
        public static void main(String[] args) {
            double sum=0;
            double a=0;

            System.out.println("请输入是否是会员"+"\n"+"请输入购买商品总价");
            Scanner in=new Scanner(System.in);
            String huiyuan=in.next();
            double zongjia = in.nextDouble();
            if((huiyuan.equals("是"))&&(zongjia>=100)){
                sum=zongjia*0.8;
                a=zongjia*0.2;
                System.out.println("折扣额="+a+"\n"+"最终付款的金额="+sum);
            }
             else if((huiyuan.equals("是"))&&(zongjia<100)){
                sum=zongjia*0.9;
                a=zongjia*0.1;
                System.out.println("折扣额="+a+"\n"+"最终付款的金额="+sum);
            }
            else if((huiyuan.equals("否"))&&(zongjia>=100)){
                sum=zongjia*0.9;
                a=zongjia*0.1;
                System.out.println("折扣额="+a+"\n"+"最终付款的金额="+sum);
            }
             else if((huiyuan.equals("否"))&&(zongjia<100)){
                sum=zongjia;
                System.out.println("折扣额="+a+"\n"+"最终付款的金额="+sum);
            }


}
}














